package cn.mhome.merchant.dao.jpa.clazz;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import cn.mhome.merchant.dao.common.po.ClassBusiness;

/**
 * 
 * @author lvpeng
 *
 */
public interface ClassBusinessDao extends JpaRepository<ClassBusiness,Long>{

	/**
	 * 
	 * @param classTypeId
	 */
	@Modifying
	@Query("DELETE FROM ClassBusiness WHERE classId=:classTypeId")
	void deleteRelationByCId(@Param("classTypeId") long classTypeId);

	/**
	 * 
	 * @param businessId
	 */
	@Modifying
	@Query("DELETE FROM ClassBusiness WHERE businessId=:businessId")
	void deleteRelationByBId(@Param("businessId")long businessId);

}
